// 拼接url参数
export let urlParams = params => {
  let urlParams = ''
  if (params && params.constructor === Object) {
    let str = '?'
    for (const key in params) {
      if (params.hasOwnProperty(key)) {
        const element = params[key];
        str = `${str}${key}=${element}&`
      }
    }
    urlParams = str.slice(0, -1)
  }
  return urlParams
}